package com.woniuxy.goods.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.woniuxy.goods.model.entity.PullVo;
import com.woniuxy.model.entity.Goods;
import com.woniuxy.model.vo.AddGoodsVo;
import com.woniuxy.model.vo.GoodsVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface GoodsMapper extends BaseMapper<Goods> {
    @Select("select * from (select gl.*,u.account as aname from goods_list gl left join `user` u on gl.aid = u.id) AS result"
            + " ${ew.customSqlSegment}")
    List<Goods> selectPageCondition(Page<Goods> page, @Param(Constants.WRAPPER) LambdaQueryWrapper<GoodsVo> queryWrapper);

    //乌龙
    //IPage<GoodsVo> selectPageCondition01(Page<GoodsVo> page, GoodsVo goodsVo );

    List<Goods> findByListNumber(List<AddGoodsVo> addGoodsList);
}
